home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / Pascal / Snippets / AntiAlias II / Anti.p next >
Encoding:
Text File  |  1995-12-02  |  943 b   |  52 lines  |  [TEXT/PJMM]

  1. {See antialias.p for comments.}
  2.  
  3. program anti;
  4.     uses
  5. {$IFC UNDEFINED THINK_PASCAL}
  6.         Types, QuickDraw, Events, Menus, Dialogs, Fonts, Resources, Devices, 
  7. {$ENDC}
  8.         AntiAlias;
  9.  
  10.     var
  11.         rBounds, r: Rect;
  12.         wind: WindowPtr;
  13.         ph: PicHandle;
  14.  
  15.     procedure InitMacintosh;
  16.     begin
  17. {$IFC UNDEFINED THINK_PASCAL}
  18.         MaxApplZone;
  19.  
  20.         InitGraf(@qd.thePort);
  21.         InitFonts;
  22.         FlushEvents(everyEvent, 0);
  23.         InitWindows;
  24.         InitMenus;
  25.         TEInit;
  26.         InitDialogs(nil);
  27. {$ENDC}
  28.         InitCursor;
  29.     end; {InitMacintosh}
  30.  
  31. begin
  32.     InitMacintosh;
  33.  
  34.     SetRect(rBounds, 50, 50, 400, 350);
  35.     wind := NewCWindow(nil, rBounds, 'AntiAliasTest', true, plainDBox, WindowPtr(-1), false, 0);
  36.     SetPort(wind);
  37.  
  38.     TextSize(48);
  39.     MoveTo(10, 40);
  40.     DrawString('Testarneshatt');
  41.     MoveTo(10, 40 + 50);
  42.     if ADrawString('Testarneshatt') <> noErr then
  43.         SysBeep(1);
  44.  
  45.     ph := GetPicture(128);
  46.     SetRect(r, 0, 100, 350, 300);
  47.     if ADrawPicture(ph, r) <> noErr then
  48.         SysBeep(1);
  49.  
  50.     while not Button do
  51.         ;
  52. end.